import request from '@/utils/request'

export function login(data) {
  return request({
    // url: '/vue-admin-template/user/login',
    url: '/login',
    method: 'post',
    data
  })
}

export function resetPassWord(data) {
  return request({
    url: '/resetPassword',
    method: 'put',
    data
  })
}

export function changeState(data) {
  return request({
    url: '/userState',
    method: 'put',
    data
  })
}

export function addUser(data) {
  return request({
    url: '/addUser',
    method: 'post',
    data
  })
}

// https://36.140.36.223/api2/admins/userList?pageSize=1&pageIndex=0&username=aaron&nickname=小东&type=0&state=1
// method：GET

export function getUserInfo(params) {
  return request({
    url: '/userList',
    method: 'get',
    params
  })
}

export function cheackUserInfo(params) {
  return request({
    url: '/user',
    method: 'get',
    params
  })
}

export function logout() {
  return request({
    url: '/vue-admin-template/user/logout',
    method: 'post'
  })
}

